from PyPDF2 import PdfReader

# 打开 PDF 文件
reader = PdfReader("01.pdf")

# 获取页面数
num_pages = len(reader.pages)
print(f"Total pages: {num_pages}")

# 读取每一页的内容
for page_num in range(num_pages):
    page = reader.pages[page_num]
    text = page.extract_text()
    print(f"Page {page_num + 1}:\n{text}")
